package com.xzl.time.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xzl.time.pojo.Comment;
import com.xzl.time.pojo.vo.AddCommentParamVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CommentMapper extends BaseMapper<Comment> {
    //通过文章id查询文章
    List<Comment> selectByArticleId(String articleId);

    //通过顶级评论id查询评论
    List<Comment> findByCeilingCommentId(String ceilingCommentId);

    //通过评论id加评论数
    void fabulous(String commentId);

    //新增评论
    void insertComment(@Param("comment") AddCommentParamVo comment);

    int deleteByIdAndUserName(String id, String userName);
}